package testPaper;

/**
 * @author Yancy
 * @program springioctest
 * @create 2020-11-21
 */
public class MBankComlex {
    private static int sum = 2000;
    public synchronized static void take(int k){
        int temp = sum;
        temp -= k;
        try {
            Thread.sleep((int)(100 * Math.random()));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        sum = temp;
    System.out.println(Thread.currentThread() + "sum ="+sum);
    }
}
